﻿using IDAL;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public class BaseDeleteDAL<T> : BaseDAL<T>, IBaseDeleteDAL<T> where T : BasesDeleteEntity
    {
        UnmanContexts _dbContext;

        public BaseDeleteDAL(UnmanContexts dbContext):base(dbContext)
        {
            _dbContext = dbContext;
        }
        /// <summary>
        /// 根据Id获取实体
        /// </summary>】
        /// <param name="Id"></param>
        /// <returns></returns>
        public T GetEntityById(string Id)
        {
            return _dbContext.Set<T>().FirstOrDefault(u => u.Id == Id);
        }
    }
}

